package model

import "time"

// internal/model/datasource.go
type DataSource struct {
	ID         uint      `gorm:"primaryKey"`
	SourceName string    `gorm:"type:varchar(50);uniqueIndex;comment:数据源名称"`
	DBType     string    `gorm:"type:varchar(20);comment:数据库类型(mysql/oracle/sqlserver)"`
	Host       string    `gorm:"type:varchar(50);comment:数据库地址"`
	Port       int       `gorm:"comment:端口号"`
	DBName     string    `gorm:"type:varchar(50);comment:数据库名"`
	Username   string    `gorm:"type:varchar(50);comment:用户名"`
	Password   string    `gorm:"type:varchar(255);comment:加密密码(AES-256)"`
	Timeout    int       `gorm:"comment:连接超时（秒）"`
	HospitalID uint      `gorm:"comment:关联医院ID"`
	CreatedAt  time.Time `gorm:"comment:创建时间"`
	UpdatedAt  time.Time `gorm:"comment:更新时间"`
}
